function RequestManager(me) {
  var incomingIds = new Object();
  var deniedIds = new Object();
  var abortedIds = new Object();
  var issuedIds = new Object();
  var successIds = new Object();
  

  this.updateIncoming = function updateIncoming(incoming){
	for (var i=0; i<incoming.length; i++){
		var trasId = incoming[i].trans.id;
		if (!incomingIds[trasId] ||incomingIds[trasId]==null ){
		
		  var mydiv = document.createElement("div");
		  mydiv.style.position = "absolute";
		  mydiv.style.top = (600+i*20)+"px";
		  mydiv.style.left = "0px";
		  mydiv.style.zIndex = i*5;
		  mydiv.oTop = (600+i*20)+"px";
		  mydiv.oLeft = "0px";
		  document.body.appendChild(mydiv); 
		  mydiv.id=trasId;
		  incomingIds[trasId] = mydiv;
		  var data = new Object();
		  data.t = incoming[i]; 
		  data.title="Incoming Request";
		  data.titlecolor = 'rgb(187,255,255)';
		  data.type = "incoming";
		  mydiv.innerHTML = TrimPath.processDOMTemplate("requestTemplate", data);		  
		}			  
	}  	
  
  }
  
  this.updateIssued = function(issued){
    	for (var i=0; i<issued.length; i++){
		var trasId = issued[i].trans.id;
		if (!issuedIds[trasId] ||issuedIds[trasId]==null ){
		  var mydiv = document.createElement("div");
		  mydiv.style.position = "absolute";
		  mydiv.style.top = (600+i*20)+"px";
		  mydiv.style.left = "100px";
		  mydiv.style.zIndex = i*5;
		  mydiv.oTop = (600+i*20)+"px";
		  mydiv.oLeft = "100px";
		  document.body.appendChild(mydiv); 
		  mydiv.id=trasId;
		  issuedIds[trasId] = mydiv;
		  var data = new Object();
		  data.t = issued[i]; 
		  data.title="Issued Request";
		  data.titlecolor = 'rgb(193,255,193)';
		  data.type = "issued";
		  mydiv.innerHTML = TrimPath.processDOMTemplate("requestTemplate", data);		  
		}			  
	}
  }
  
  
  this.updateDenied = function(denied){
    	for (var i=0; i<denied.length; i++){
    	if(denied[i]){
//    	alert(i);
		var trasId = denied[i].trans.id;
		if (issuedIds[trasId] &&issuedIds[trasId]!=null&&issuedIds[trasId].id ){
		  try{
            document.body.removeChild(issuedIds[trasId]);
          }catch(e){
          }
        }
        
        if (!deniedIds[trasId] ||deniedIds[trasId]==null ){
		  var mydiv = document.createElement("div");
		  //var mydiv = document.createElement("div");
		  mydiv.style.position = "absolute";
		  mydiv.style.top = (600+i*20)+"px";
		  mydiv.style.left = "300px";
		  mydiv.style.zIndex = i*5;
		  mydiv.oTop = (600+i*20)+"px";
		  mydiv.oLeft = "300px";
		  document.body.appendChild(mydiv); 
		  deniedIds[trasId] = mydiv;
		  mydiv.id=trasId;
		  var data = new Object();
		  data.t = denied[i]; 
		  data.title="Denied Request";
		  data.titlecolor = 'rgb(255,106,106)';
		  data.type = "denied";
		  mydiv.innerHTML = TrimPath.processDOMTemplate("requestTemplate", data);		  
		//  alert( mydiv.innerHTML);
		}
	}
  }
  }
  
    this.updateAborted = function(aborted){
    	for (var i=0; i<aborted.length; i++){
    	if(aborted[i]){
		var trasId = aborted[i].trans.id;
		if (incomingIds[trasId] &&incomingIds[trasId]!=null&& incomingIds[trasId].id){
		  try{
          	document.body.removeChild(incomingIds[trasId]);
          }catch(e){
          }
        }
        
        if (issuedIds[trasId] &&issuedIds[trasId]!=null&&issuedIds[trasId].id){
         try {
          document.body.removeChild(issuedIds[trasId]);
          }catch(e){
          }
        }
        
        if (!abortedIds[trasId] ||abortedIds[trasId]==null ){
		  var mydiv = document.createElement("div");
		  //var mydiv = document.createElement("div");
		  mydiv.style.position = "absolute";
		  mydiv.style.top = (600+i*20)+"px";
		  mydiv.style.left = "500px";
		  mydiv.style.zIndex = i*5;
		  mydiv.oTop = (600+i*20)+"px";
		  mydiv.oLeft = "500px";
		  document.body.appendChild(mydiv); 
		  abortedIds[trasId] = mydiv;
		  mydiv.id=trasId;
		  var data = new Object();
		  data.t = aborted[i]; 
		  data.title="Aborted Request";
		  data.titlecolor = 'rgb(255,106,106)';
		  data.type = "aborted";
		  mydiv.innerHTML = TrimPath.processDOMTemplate("requestTemplate", data);		  
		 // alert( mydiv.innerHTML);
		}
	}
  }
  }
  
  this.updateSuccess = function(success){
    	for (var i=0; i<success.length; i++){
    	if(success[i]){
		var trasId = success[i].trans.id;
		if (incomingIds[trasId] &&incomingIds[trasId]!=null&& incomingIds[trasId].id){
		  try{
          document.body.removeChild(incomingIds[trasId]);
          }catch(e){
          }
        }
        
        if (issuedIds[trasId] &&issuedIds[trasId]!=null && issuedIds[trasId].id){
          try{
          document.body.removeChild(issuedIds[trasId]);
          }catch (e){
          }
        }
        
        if (!successIds[trasId] ||successIds[trasId]==null ){
		  var mydiv = document.createElement("div");
		  //var mydiv = document.createElement("div");
		  mydiv.style.position = "absolute";
		  mydiv.style.top = (600+i*20)+"px";
		  mydiv.style.left = "700px";
		  mydiv.style.zIndex = i*5;
		  mydiv.oTop = (600+i*20)+"px";
		  mydiv.oLeft = "700px";
		  document.body.appendChild(mydiv); 
		  successIds[trasId] = mydiv;
		  mydiv.id=trasId;
		  var data = new Object();
		  data.t = success[i]; 
		  data.title="Succeed Request";
		  data.titlecolor = 'rgb(188,238,104)';
		  data.type = "success";
		  mydiv.innerHTML = TrimPath.processDOMTemplate("requestTemplate", data);		  
		 // alert( mydiv.innerHTML);
		}
	}
  }
  }
  
   /*this.update = function updateDenied(denied){
	for (var i=0; i<denied.length; i++){
		var trasId = denied[i].trans.id;
		if (!deniedIds[trasId] ||deniedIds[trasId]==null ){
		  var mydiv = document.createElement("div");
		  mydiv.style.position = "absolute";
		  mydiv.style.top = "400px";
		  mydiv.style.left = "600px";
		  mydiv.style.zIndex = i*5;
		  document.body.appendChild(mydiv); 
		  mydiv.id=trasId;
		  deniedIds[trasId] = mydiv;
		  var data = new Object();
		  data.t = deniedIds[i]; 
		  data.title="incoming message";
		  data.titlecolor = 'rgb(187,255,255)';
		  mydiv.innerHTML = TrimPath.processDOMTemplate("requestTemplate", data);		  
		}			  
	} 
  
  }*/
   
  
}